package models

import (
	"time"
)

// MaPhysicalInfo [...]
type MaPhysicalInfo struct {
	ID          uint      `gorm:"autoIncrement:true;primaryKey;column:id;type:int unsigned;not null"  json:"id" json_old:"ID"`
	Msg         string    `gorm:"index:idx_saleid_addtime_msg,priority:3,type:btree;column:msg;type:varchar(50);not null;comment:订单号"  json:"msg" json_old:"Msg"`
	Age         int       `gorm:"column:age;type:int;not null;comment:年龄"  json:"age" json_old:"Age"`
	AgeRange    int       `gorm:"index:idx_addtime_type_age_range_sex,priority:3;index:idx_saleid_addtime_msg,priority:4,type:btree;column:age_range;type:int;comment:年龄段" json:"age_range"`
	Sex         int       `gorm:"index:idx_addtime_type_age_range_sex,priority:4;index:idx_saleid_addtime_msg,priority:5,type:btree;column:sex;type:tinyint(1);not null;comment:性别 1男 2女 "  json:"sex" json_old:"Sex"`
	AddTime     time.Time `gorm:"index:idx_addtime_type_age_range_sex,priority:1;index:idx_saleid_addtime_msg,priority:2,type:btree;column:add_time;type:datetime;not null"  json:"add_time" json_old:"AddTime"`
	Type        int       `gorm:"index:idx_addtime_type_age_range_sex,priority:2;column:type;type:tinyint(1);not null;default:0;comment:1点击 2创单 3支付 4 点击空白（非商品）"  json:"type" json_old:"Type"`
	SalesID     string    `gorm:"index:idx_saleid_addtime_msg,priority:1,type:btree;column:sales_id;type:varchar(50);not null"  json:"sales_id" json_old:"SalesID"`
	RobotName   string    `gorm:"index:idx_createdDate_robotName,priority:2;column:robot_name;type:varchar(50);comment:机器人名称" json:"robot_name" json_old:"RobotName"`
	CreatedAt   int64     `gorm:"index:created_at;column:created_at;autoCreateTime;type:int;size:64;comment:创建时间" json:"created_at"`
	CreatedDate time.Time `gorm:"index:idx_createdDate_robotName,priority:1;column:created_date;type:date;comment:日期" json:"created_date" json_old:"CreatedDate"`
}

// TableName get sql table name.获取数据库表名
func (m MaPhysicalInfo) TableName() string {
	return "ma_physical_info"
}

// 模式自动注册
func init() {
	Models = append(Models, &MaPhysicalInfo{})
}
